using System.ComponentModel.DataAnnotations;
using UwinEducation.Shared.Enums;
using UwinEducation.Shared.Models;

namespace UwinEducation.Application.Dtos
{
    /// <summary>
    /// 学生DTO
    /// </summary>
    public class StudentDto
    {
        /// <summary>
        /// 学生ID
        /// </summary>
        public Guid Id { get; set; }

        /// <summary>
        /// 学号
        /// </summary>
        public string StudentNo { get; set; }

        /// <summary>
        /// 姓名
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 学校
        /// </summary>
        public string School { get; set; }

        /// <summary>
        /// 年级
        /// </summary>
        public GradeEnum? Grade { get; set; }
        /// <summary>
        /// 预约次数
        /// </summary>
        public int? AppointmentCount { get; set; }
        /// <summary>
        /// 备注
        /// </summary>
        public string Remarks { get; set; }

        /// <summary>
        /// 电话
        /// </summary>
        public string? Phone { get; set; }
        /// <summary>
        /// 邮箱
        /// </summary>
        public string? Email { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreatedAt { get; set; }
    }

    /// <summary>
    /// 创建学生DTO
    /// </summary>
    public class CreateStudentDto
    {
        /// <summary>
        /// 学号
        /// </summary>
        [Required(ErrorMessage = "学号不能为空")]
        public string StudentNo { get; set; }

        /// <summary>
        /// 姓名
        /// </summary>
        [Required(ErrorMessage = "姓名不能为空")]
        public string Name { get; set; }

        /// <summary>
        /// 学校
        /// </summary>
        //[Required(ErrorMessage = "学校不能为空")]
        public string? School { get; set; }

        /// <summary>
        /// 年级
        /// </summary>
        [Required(ErrorMessage = "年级不能为空")]
        //[Range(1, 13, ErrorMessage = "年级参数不合法，合法参数：1-13")]
        public GradeEnum Grade { get; set; }
        /// <summary>
        /// 备注
        /// </summary>
        public string? Remarks { get; set; }
        /// <summary>
        /// 电话
        /// </summary>
        public string? Phone { get; set; }
        /// <summary>
        /// 邮箱
        /// </summary>
        public string? Email { get; set; }
    }

    /// <summary>
    /// 更新学生DTO
    /// </summary>
    public class UpdateStudentDto: CreateStudentDto
    {
        /// <summary>
        /// 学生ID
        /// </summary>
        [Required(ErrorMessage = "学生ID不能为空")]
        public Guid Id { get; set; }
    }

}